package com.Tradition.common.check;

import java.util.regex.Pattern;

/**
@Note:String类型相关检查
@Author:zhuxiao
@Date:2018/6/10
**/

public class StringCheckUtils {
    private static  String userNamePattern="^[a-zA-Z0-9]{6,20}$"; //用户名校验正则表达式
    private static  String passwordPattern="^.{6,20}$"; //密码校验正则表达式


    public static boolean UserNameFormat(String username){
        return Pattern.matches(userNamePattern, username);
    }
    public static boolean PasswordFormat(String password){
        return Pattern.matches(passwordPattern, password);
    }
}
